#include "dbimagemanager.h"
#include <QDir>
#include <iostream>

using namespace std;
using namespace models;

DBImageManager::DBImageManager()
{
}

DBImageManager::~DBImageManager()
{

}

QVector<Mat> DBImageManager::getDBImages()
{
    QVector<Mat> imgList;

    // Read images from the directory
    QStringList nameFilter("*.png");
    QDir directory(DB_IMAGES_DIR);
    QStringList imageFiles = directory.entryList(nameFilter);
    Mat image;

    foreach (QString file, imageFiles) {
        image = imread(QString("%1/%2").arg(DB_IMAGES_DIR, file).toStdString(), CV_LOAD_IMAGE_COLOR);
        imgList.append(image);
    }

    return imgList;
}
